#ifdef __cplusplus
extern "C" {
#endif


#ifndef WORK_H
#define WORK_H
#include "common.h"


typedef enum{
	TYPE_DO_COLD,
	TYPE_DO_HOT,
}WORK_TYPE;

typedef enum{
	STATE_NOT_READY,
	STATE_READY,
	STATE_WORKING,
	STATE_FINISHED,
}WORK_STATE;

typedef enum{
	MSG_TEMPER,
	MSG_HUMI,
	MSG_WORK_STATE,
	MSG_WORK_TIME,
	MSG_WORK_INIT_STEP,
}MSG_TYPE;

typedef enum{
	STEP_SENSOR,
	STEP_CTRB,
	STEP_SYSTEM,
	STEP_DONE,
}INIT_STEP;

typedef struct{
	MSG_TYPE type;
	float value;
}CALLBACK_MSG;

typedef enum{
	SWITCH_OFF,
	SWITCH_ON,
	SWITCH_COLD,
	SWITCH_HOT,
}CTRB_STATE_SWITCH;

typedef enum{
	CTRB_SWITCH_ON,
	CTRB_SWITCH_OFF,
}CMD_CTRB_SWITCH;

typedef enum{
	CTRB_CORE_COLD,
	CTRB_CORE_HOT,
	CTRB_CORE_OFF
}CMD_CTRB_CORE;


typedef struct{
	CTRB_STATE_SWITCH s_fan;
	CTRB_STATE_SWITCH s_light1;
	CTRB_STATE_SWITCH s_light2;
	CTRB_STATE_SWITCH s_light3;
	CTRB_STATE_SWITCH s_humi;
	CTRB_STATE_SWITCH s_core;
}CTRB_STATE;

#ifndef U64
#define U64 unsigned long long int
#endif

extern RETURN_ID Api_Work_Init(void *device,int (*callback)(void *device,CALLBACK_MSG msg));
extern RETURN_ID Api_Work_Start(float tar_temper,float tar_humi,U64 time);
extern RETURN_ID Api_Work_Stop();
extern RETURN_ID Api_Work_Uninit();

extern RETURN_ID Api_Work_CtrbCmd_Fan(CMD_CTRB_SWITCH s);
extern RETURN_ID Api_Work_CtrbCmd_Light1(CMD_CTRB_SWITCH s);
extern RETURN_ID Api_Work_CtrbCmd_Light2(CMD_CTRB_SWITCH s);
extern RETURN_ID Api_Work_CtrbCmd_Light3(CMD_CTRB_SWITCH s);

extern WORK_STATE Api_Work_Get_WorkState();
extern CTRB_STATE Api_Work_Get_CtrbState();
extern float Api_Work_Get_Temper();
extern float Api_Work_Get_Humi();

#endif

#ifdef __cplusplus
}
#endif
